import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        Dog dog=new Dog();//new关键字创建对象
        dog.name="小黑";
        dog.color="黑色";
        Dog dog1;
        Dog dog2;



    }




    public static void main4(String[] args) {
        int[] array={3,2,4,6,9,8,7,0,11,13};
        System.out.println(con(array));
        bubbleSort(array);
        System.out.println(con(array));
        System.out.println(Arrays.toString(array));
    }
    public static int fun2(int[] array){
        Arrays.sort(array);
        return array[array.length/2];
    }
    public static int fun1(int[] array){
        int ret=0;
        for (int i = 0; i < array.length; i++) {
            ret^=array[i];
        }
        return ret;
    }
    public static int[] fun(int[] array,int target){
        int[] tmp= new int[]{-1,-1};
        for (int i = 0; i < array.length-1; i++) {
            for (int j = 0; j < array.length; j++) {
                if(array[i]+array[j]==target){
                    tmp[0]=i;
                    tmp[1]=j;
                }
            }
        }
        return tmp;
    }
    public static void main2(String[] args) {
        int[] array3=new int[]{1,2,3,4,5};
       int[] copy=adjustOrder(array3);
       // System.out.println(Arrays.toString(copy));
//        String ret=myToString(array);
//        System.out.println(ret);
       // int[] copy= Arrays.copyOf(array,array.length);//超出长度扩容的为0
        //int[] copy=Arrays.copyOfRange(array,1,3);//[1,3)范围一般为左开右闭
        //System.out.println(binarySearch(array, 3));
       // System.out.println(Arrays.binarySearch(array,3));//java自带的二分查找
        int[] array1={1,3,5,6,73,9};
        //Arrays.sort(array1);//排序
       // boolean flg= Arrays.equals(array,array1);//判断两个数组是否相等
        //Arrays.fill(array1,-1);//填充为指定的值
      //  System.out.println(Arrays.toString(array1));

        // System.out.println(Arrays.toString(copy));

    }
    public static int[] adjustOrder(int[] array) {
        int[] cop = Arrays.copyOf(array, array.length);
        int j = 0;
        for (int i = 0; i < cop.length; i++) {

            if (array[i] % 2 != 0) {
                cop[j++] = array[i];
            }
        }
        for (int i = 0; i < array.length; i++) {
            if (array[i] % 2 == 0) {
                cop[j++] = array[i];
            }

        }return cop;
    }
//    public static void transform(int[] array){
//        for (int i = 0; i < array.length; i++) {
//            array[i]*=2;
//        }
//    }
    public static int binarySearch(int[] array,int key){
        int left=0;
        int right=array.length-1;
        while(left<=right){
            int mid=(left+right)/2;
            if(array[mid]<key){
                left=mid+1;
            }else if(array[mid]>key){
                right=mid-1;
            }else{
                return mid;
            }
        }
        return -1;
    }
    public static boolean con(int[] array){
        int count=0;
        for (int i = 0; i < array.length; i++) {
            if(array[i]%2!=0){
                count++;
            }else{
                count=0;
            }
            if(count==3){
                return true;
            }
        }
        return false;
    }
    public static void bubbleSort(int[] array){
        for (int i = 0; i < array.length-1; i++) {
            for(int j=0;j<array.length-1-i;j++){
                if(array[j]>array[j+1]){
                    int temp=array[j];
                    array[j]=array[j+1];
                    array[j+1]=temp;
                }
            }
        }
    }
        //数组转字符串
//    public static String myToString(int[] array){
//        String ret="[";
//        for (int i = 0; i < array.length; i++) {
//        if(i!=array.length-1){
//            ret+=array[i]+",";
//        }else{
//            ret+=array[i]+"]";
//        }
//        }
//        return ret;
//    }
    }
